//
//  RootTbaBarController.m
//  XingRun
//
//  Created by 赵颜彬 on 17/1/11.
//  Copyright © 2017年 赵颜彬. All rights reserved.
//

#import "RootTbaBarController.h"

@interface RootTbaBarController ()

@property(nonatomic, strong)UINavigationController *homeNC;

@end

@implementation RootTbaBarController

- (void)dealloc{
    [self setHomeNC:nil];
    [self setViewControllers:nil];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    /********* HOME **********/
    InformationViewController *homeVC = [[InformationViewController alloc]init];
    
    // 创建导航
    _homeNC = [[UINavigationController alloc] initWithRootViewController:homeVC];
    // tabBar按钮
    homeVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"首页" image:[UIImage imageNamed:@"首页"] tag:1000];
    
    /********** Availability ************/
    RankViewController *RankVC = [[RankViewController alloc]init];
    UINavigationController *RankNC = [[UINavigationController alloc] initWithRootViewController:RankVC];
    RankVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"排行" image:[UIImage imageNamed:@"排行"] tag:2000];
    
    /************** Visitor ************/
    CyclViewController *CyVC = [[CyclViewController alloc] init];
    UINavigationController *CyNC = [[UINavigationController alloc] initWithRootViewController:CyVC];
    CyVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"骑行" image:[UIImage imageNamed:@"骑行"] tag:3000];
    
    /*************Mail******************/
    MailViewController *MailVC = [[MailViewController alloc] init];
    UINavigationController *MailNC = [[UINavigationController alloc] initWithRootViewController:MailVC];
    MailVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"商城" image:[UIImage imageNamed:@"商城"] tag:4000];
    
    
    /*************** Mine ****************/
    MineViewController *MineVC = [[MineViewController alloc] init];
    UINavigationController *MineNC = [[UINavigationController alloc] initWithRootViewController:MineVC];
    MineVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"我的" image:[UIImage imageNamed:@"我的"] tag:5000];
    
    self.viewControllers = @[_homeNC, RankNC, CyNC, MailNC, MineNC];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
